package UseIO.UseBufferedInOutStream;

import java.io.*;

public class BufferedInOutStream {
    public static void main(String[] args) throws IOException {
        method02();
    }
    public static void method01() throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("8.内置模块/UseIO/copy.mp4"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("8.内置模块/UseIO/copy01.mp4"));
        int b;
        while ((b=bis.read())!=-1){
            bos.write(b);
        }
        bis.close();
        bos.close();
    }


    public static void method02() throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("8.内置模块/UseIO/copy.mp4"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("8.内置模块/UseIO/copy01.mp4"));
        int b;
        byte[] bytes = new byte[1024];
        while ((b=bis.read(bytes))!=-1){
            bos.write(bytes,0,b);
        }
        bis.close();
        bos.close();
    }
}
